<template>
  <!--忘带卡明细-->
  <div class="contentRight2">
    <div id="tools">
      <div class="height8"></div>
      <!-- 查询条件 -->
      <a-form layout="inline" style="text-align: left;padding: 0 10px;" :selfUpdate="true">
        <a-form-item label="关键字" class="marginBtm">
          <a-input v-model="queryValue" allowClear placeholder="请输入工号/姓名/部门" class="marginBtm"
                   @pressEnter="inquireStart"/>
        </a-form-item>

        <a-form-item label="开始日期" class="marginBtm">
          <a-date-picker
            :allowClear="false"
            :disabledDate="disabledStartDate"
            v-model="startDate"
            placeholder="开始日期"
            style="width: 140px"
          />
        </a-form-item>
        <a-form-item label="结束日期" class="marginBtm">
          <a-date-picker
            :allowClear="false"
            :disabledDate="disabledEndDate"
            placeholder="结束日期"
            v-model="endDate"
            :open="endOpen"
            @openChange="handleEndOpenChange"
            style="width: 140px"
          />
        </a-form-item>

        <!--<a-form-item label="审批状态" class="marginBtm">-->
          <!--<a-dropdown class="min-width-110">-->
            <!--<a-menu slot="overlay" @click="handleMenuClick">-->
              <!--<a-menu-item :key="item.id" v-for="item in approvalStatus">{{item.name}}</a-menu-item>-->
            <!--</a-menu>-->
            <!--<a-button block>-->
              <!--<div class="query-conditions">-->
                <!--{{ statusValue }}-->
                <!--<a-icon type="down"/>-->
              <!--</div>-->
            <!--</a-button>-->
          <!--</a-dropdown>-->
        <!--</a-form-item>-->

        <a-form-item label="基地" class="marginBtm">
          <a-dropdown class="min-width-110">
            <a-menu slot="overlay" @click="baseMenuClick">
              <a-menu-item :key="item.id" v-for="item in baceType">{{item.name}}</a-menu-item>
            </a-menu>
            <a-button>
              <div class="query-conditions">
                {{ visitBaseName }}
                <a-icon type="down"/>
              </div>
            </a-button>
          </a-dropdown>
        </a-form-item>

        <a-form-item label="区域" class="marginBtm">
          <a-dropdown class="min-width-110">
            <a-menu slot="overlay" @click="areaMenuClick">
              <a-menu-item :key="item.id" v-for="item in areaList">{{item.areaName}}</a-menu-item>
            </a-menu>
            <a-button>
              <div class="query-conditions">
                {{ areaName }}
                <a-icon type="down"/>
              </div>
            </a-button>
          </a-dropdown>
        </a-form-item>

        <!--<template>-->
          <!--<a-form-item label="门" class="marginBtm">-->
            <!--<a-dropdown class="min-width-110">-->
              <!--<a-menu slot="overlay" @click="doorMenuClick">-->
                <!--<a-menu-item :key="item.typeId" v-for="item in doorList">{{item.name}}</a-menu-item>-->
              <!--</a-menu>-->
              <!--<a-button>-->
                <!--<div class="query-conditions">-->
                  <!--{{ doorName }}-->
                  <!--<a-icon type="down"/>-->
                <!--</div>-->
              <!--</a-button>-->
            <!--</a-dropdown>-->
          <!--</a-form-item>-->
        <!--</template>-->

        <!--<a-form-item label="访客类型" class="marginBtm">-->
          <!--<a-dropdown class="min-width-110">-->
            <!--<a-menu slot="overlay" @click="visitorTypeClick">-->
              <!--<a-menu-item :key="item.typeId" v-for="item in visitorTypeList">{{item.name}}</a-menu-item>-->
            <!--</a-menu>-->
            <!--<a-button>-->
              <!--<div class="query-conditions">-->
                <!--{{ visitorTypeName }}-->
                <!--<a-icon type="down"/>-->
              <!--</div>-->
            <!--</a-button>-->
          <!--</a-dropdown>-->
        <!--</a-form-item>-->

        <a-form-item label="忘带卡类型" class="marginBtm">
          <a-dropdown class="min-width-140">
            <a-menu slot="overlay" @click="visitStateClick">
              <a-menu-item :key="item.id" v-for="item in forgotTypes">{{item.name}}</a-menu-item>
            </a-menu>
            <a-button>
              <div class="query-conditions">
                {{ forgotTypeValue }}
                <a-icon type="down"/>
              </div>
            </a-button>
          </a-dropdown>
        </a-form-item>

        <a-form-item class="marginBtm">
          <a-button type="primary" @click="inquireStart">
            查询
          </a-button>
        </a-form-item>

      </a-form>
      <a-divider style="margin: 5px 0"/>
      <div class="divPadiAlign">
        <a-button type="primary" class="button-marin" @click="exportList">
          导出
        </a-button>
        <!--<a-button type="primary" class="button-marin" @click="addDilog">-->
        <!--新增-->
        <!--</a-button>-->
      </div>
    </div>

    <a-table
      class="tabled"
      bordered
      :fixed="true"
      size="small"
      :columns="columns"
      :row-key="record => record.id"
      :data-source="tableData"
      :pagination="pagination"
      :loading="loading"
      :scroll="{ x:xWidth,y: yHeight }"
      :locale="localezh_CN"
      @change="handleTableChange"
    >
      <!--设置单选按钮，点击选中行-->
      <!--:rowSelection="{type:'radio',selectedRowKeys:selectedRowKeys,fixed:true,onChange:onChange}"-->
      <!--:customRow="clickRow"   点击行选中-->

      <!-- <template slot="name" slot-scope="name"> {{ name.first }} {{ name.last }} </template> -->
      <!--<span slot="operate" slot-scope="text,data">-->
        <!--<a @click="()=>seePhoto(data)">查看图片</a>-->
      <!--</span>-->
    </a-table>

    <!--导出加载中-->
    <customLoading :customVisible="spinning"></customLoading>

    <!--设备目录-->
    <a-modal
      v-model="photoVisible"
      title="查看图片"
      width="1100px"
      :destroyOnClose="true"
      :maskClosable="false"
      :keyboard="false">
      <template slot="footer">
        <a-button key="submit" type="primary" @click="savephoto">
          保存图片
        </a-button>
        <a-button key="back" @click="handleCancel">
          关闭
        </a-button>
      </template>
      <a-spin :spinning="photoSpinning">
        <div style="width: 100%;height: 66vh;overflow: auto">
          <img v-for="item in lookImg " :src="item" alt="" style="width: 320px;margin:0 20px 20px 0;object-fit: cover;">
        </div>
      </a-spin>

    </a-modal>

  </div>
</template>

<script>
  import {tableBoxHeight} from "@/api/communal";
  import reservationApi from "@/api/reservation";
  import forgotCardManageApi from "@/api/forgotCardManage";
  import localezh_CN from 'antd/lib/locale-provider/zh_CN';
  import dateUtil from "@/utils/dateUtils";
  import moment from "moment";
  import {ConfigProvider} from 'ant-design-vue';//引用
  import 'moment/locale/zh-cn';
  import cfg from '@/config/config'

  export default {
    components: {
      ConfigProvider
    },
    name: '',
    data() {
      return {
        localezh_CN,
        spinning: false,
        xWidth: "",
        yHeight: "",
        tableData: [],
        pagination: {
          pageSize: 30,
          current: 1,
          total: 0,
          showSizeChanger: true,
          // showQuickJumper: true,
          pageSizeOptions: ["20", "30", "50"],
          showTotal: (total) => `共 ${total} 条`, // 显示总数
          onShowSizeChange: (current, pageSize) => {
            // console.log("1111");
            this.pagination.current = 1;
            this.pagination.pageSize = pageSize;
          },
        },
        selectedRowKeys: [],
        loading: false,
        dateFormat: 'YYYY/MM/DD',
        startDate: "",
        endDate: "",
        endOpen: false,
        startDated: "",
        endDated: "",
        queryValue: "",  //查询值,访客名称，访客手机号
        columns: [],   //表格表头
        statusValue: "全部",  //状态名称
        statusId: 99,   //状态id
        approvalStatus: [
          {name: "全部", id: 99},
          {name: "待审批", id: 0},
          {name: "审批中", id: 1},
          {name: "驳回", id: 2},
          {name: "通过", id: 3},
          {name: "自动审批", id: 4},
        ],
        photoVisible: false,
        photoSpinning: false,
        lookImg: [],
        // 忘带卡类型
        forgotTypeValue:"全部",
        forgotTypeId: 0,
        forgotTypes:[
          {name: "全部", id: 0},
        ],
        //基地列表
        visitBaseName: "全部",   //基地名称
        visitBaseId: 0,   //0查全部，或者基地id
        baceType: [
          {name: "全部", id: 0},
        ],
        //区域列表
        areaName: "全部",    //区域名称
        visitAreaId: 0,   //0查全部，或者区域id
        isHaveDoor: 0,   //是否有门 1有门 ， 0 没有门
        areaList: [
          {areaName: "全部", id: 0},
        ],
        //门列表
        doorName: "全部",    //区域名称
        doorId: "",   //门id
        doorList: [
          {name: "全部", typeId: ""},
        ],
        //访客类型
        visitorTypeName: "全部",
        visitorTypeId: 99,
        visitorTypeList: [
          {name: "全部", typeId: 99},
        ],
        //访客访问状态，99 所有  1 未到访  2 已到访  3 已离开  4 未离开
        visitTypeName: "全部",
        visitTypeId: 99,
        visitState: [
          {name: "全部", typeId: 99},
          {name: "未到访", typeId: 1},
          {name: "已到访", typeId: 2},
          {name: "访问中", typeId: 4},
          {name: "访问结束", typeId: 3},
        ],

      }
    },
    beforeMount() {
      this.columns = [
        {
          title: '序号',     //表头
          dataIndex: 'serialNumber',   //字段名称
          width: '50px',    //设列宽度
          align: 'center',  //居中显示
          fixed: "left",
          className: 'changeBack',   //重置覆盖背景色为浅灰色，否则是白色的
          customRender: (value, row, index) => `${(this.pagination.current - 1) * this.pagination.pageSize + index + 1}`  //设置动态序号
        },
        {
          title: "工号",
          dataIndex: "personalNumber",
          align: "center",
          width: "100px",
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: "姓名",
          dataIndex: "chineseName",
          align: "center",
          width: "100px",
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: "部门",
          dataIndex: "orgunitShort",
          align: "center",
          width: "120px",
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: "忘带卡类型",
          dataIndex: "forgotCardTypeName",
          align: "center",
          width: "100px",
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: "工作地点",
          dataIndex: "workLocation",
          align: "center",
          width: "100px",
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: '基地',
          dataIndex: 'baseName',
          width: '80px',
          align: 'center',
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: '区域',
          dataIndex: 'areaName',
          width: '130px',
          align: 'center',
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: '登记人',
          dataIndex: 'createByName',
          width: '100px',
          align: 'center',
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: '登记时间',
          dataIndex: 'createTime',
          width: '150px',
          align: 'center',
          ellipsis: true,
          className: 'changeBack'
        },
        {
          title: '',
          dataIndex: '',
          width: 'auto',
          align: 'center',
          className: 'changeBack'
        },
        // {
        //   title: '操作',
        //   dataIndex: 'operate',
        //   key: 'operate',
        //   width: '120px',
        //   scopedSlots: {customRender: 'operate'},
        //   fixed: "right",
        //   align: "center",
        //   className: "changeBack"
        // },

      ];
      this.startDate = moment().startOf('month');
      this.endDate = moment().endOf('month');
      this.startDated = moment(this.startDate).format('YYYY-MM-DD');
      this.endDated = moment(this.endDate).format('YYYY-MM-DD');
    },
    async mounted() {
      this.xWidth = this.getTableWidth();
      // this.statusValue = this.approvalStatus[0].name;
      // this.statusId = this.approvalStatus[0].id;
      this.getBdSysItemTypeList();  //获取忘带卡类型
      this.findRegionList();       // 获取基地
      await this.inquireStart();  //初始化表格
      // this.getVisitorType();   //获取访客类型
      // this.getDoorList();  //获取门

      this.$nextTick(()=>{
        this.yHeight = tableBoxHeight() + 3 + "px";
        let minHeight = document.getElementsByClassName("ant-table");
        minHeight[0].style.minHeight = tableBoxHeight() + 40 + "px";
      })
    },
    methods: {
      // 计算表格宽度
      getTableWidth() {
        let totals = null;
        var el;
        for (el of this.columns) {
          totals += parseInt(el.width);
        }
        return totals + 100 + "px"
      },
      // 选择日期
      onChangePicker(date, dateString) {
        // console.log(date, dateString);
        this.startDated = dateString[0];
        this.endDated = dateString[1];
      },
      //日期控件需要的方法
      disabledStartDate(startDate) {
        const endDate = this.endDate;
        if (!startDate || !endDate) {
          return false;
        }
        return startDate.valueOf() > endDate.valueOf();
      },
      disabledEndDate(endDate) {
        const startDate = this.startDate;
        if (!endDate || !startDate) {
          return false;
        }
        return startDate.valueOf() >= endDate.valueOf();
      },
      handleStartOpenChange(open) {
        // if (!open) {
        //   this.endOpen = true;
        // }
      },
      handleEndOpenChange(open) {
        this.endOpen = open;
      },

      // 导出列表
      async exportList() {
        this.startDated = this.startDate == "" || this.startDate == null ? "" : moment(this.startDate).format('YYYY-MM-DD');
        this.endDated = this.endDated == "" || this.endDated == null ? "" : moment(this.endDate).format('YYYY-MM-DD');
        if (this.startDated == "") {
          this.$message.warning("开始日期不能为空");
          return
        }
        if (this.endDated == "") {
          this.$message.warning("结束日期不能为空");
          return
        }
        this.spinning = true;
        let param = {
          current: this.pagination.current,
          pageSize: this.pagination.pageSize,
          startDate: this.startDated,
          endDate: this.endDated,
          // approvalStatus: this.statusId,
          searchTxt: this.queryValue,
          baseId: this.visitBaseId,
          areaId: this.visitAreaId == "" ? 0 : this.visitAreaId,
          forgotCardType: this.forgotTypeId
          // doorId: this.doorId,
          // visitorState: this.visitTypeId,
          // visitorsType: this.visitorTypeId,
        };
        let jsonIn = encodeURI(encodeURI(JSON.stringify(param)));
        await window.open(cfg.apiUrl + 'api/forgot/card/exportForgotCardEmpList?jsonIn=' + jsonIn, "_self");
        setTimeout(() => {
          this.spinning = false;
        }, 1000)

      },
      // 开始查询
      inquireStart() {
        this.startDated = this.startDate == "" || this.startDate == null ? "" : moment(this.startDate).format('YYYY-MM-DD');
        this.endDated = this.endDated == "" || this.endDated == null ? "" : moment(this.endDate).format('YYYY-MM-DD');
        this.pagination.current = 1;
        let param = {
          current: this.pagination.current,
          pageSize: this.pagination.pageSize,
          startDate: this.startDated,
          endDate: this.endDated,
          // approvalStatus: this.statusId,
          searchTxt: this.queryValue,
          baseId: this.visitBaseId,   //0查全部，或者基地id
          areaId: this.visitAreaId == "" ? 0 : this.visitAreaId,   //0查全部，或者区域id
          forgotCardType: this.forgotTypeId
          // doorId: this.doorId,
          // visitorState: this.visitTypeId,
          // visitorsType: this.visitorTypeId,
        };

        this.fetch(param);
      },
      // 审批状态下拉菜单
      handleMenuClick(e) {
        this.approvalStatus.filter(el => {
          if (el.id == e.key) {
            this.statusValue = el.name;
            this.statusId = el.id
          }
        });
      },
      // 切换基地，选择基地
      baseMenuClick(e) {
        this.baceType.filter(el => {
          if (el.id == e.key) {
            this.visitBaseName = el.name;
            this.visitBaseId = el.id;
            this.areaName = "全部";
            this.visitAreaId = 0;
            this.isHaveDoor = 0;
            // this.doorName = "全部";
            // this.doorId = "";
            // this.doorList = [{name: "全部", id: ""}];
            // this.visitorTypeName = "全部";
            // this.visitorTypeId = 99;
            // this.visitorTypeList = [{name: "全部", typeId: 99}];
            if (el.id == 0) {
              this.areaList = [{areaName: "全部", id: 0}];
              // this.getVisitorType()
            } else {
              this.getAreaList()
            }
          }
        });

      },
      // 切换区域，选择区域
      areaMenuClick(e) {
        this.areaList.filter(el => {
          if (el.id == e.key) {
            this.areaName = el.areaName;
            this.visitAreaId = el.id;
            // this.doorName = "全部";
            // this.doorId = "";
            // this.doorList = [{name: "全部", id: ""}];
            // this.visitorTypeName = "全部";
            // this.visitorTypeId = 99;
            // this.visitorTypeList = [{name: "全部", typeId: 99}];
            // if (el.id == 99){
            //   this.isHaveDoor = 0;
            //   this.getVisitorType()
            // } else {
            //   this.isHaveDoor = el.isHaveDoor;
            //   // isHaveDoor 1有门 ， 0 没有门
            //   if (el.isHaveDoor){
            //     this.getDoorList()
            //   } else {
            //     this.getVisitorType()
            //   }
            // }


          }
        });
      },
      // 切换门，选择门
      doorMenuClick(e) {
        this.doorList.filter(el => {
          if (el.typeId == e.key) {
            this.doorName = el.name;
            this.doorId = el.typeId;
            // this.getVisitorType();

          }
        });
      },
      // 切访客类型，选访客类型
      visitorTypeClick(e) {
        this.visitorTypeList.filter(el => {
          if (el.typeId == e.key) {
            this.visitorTypeName = el.name;
            this.visitorTypeId = el.typeId;
          }
        });
      },
      // 访客访问状态
      visitStateClick(e) {
        this.forgotTypes.filter(el => {
          if (el.id == e.key) {
            this.forgotTypeValue = el.name;
            this.forgotTypeId = el.id;
          }
        });
      },
      seePhoto(row) {
        this.lookImg = [];
        this.photoSpinning = true;
        this.photoVisible = true;
        this.getPhotoList(row.orderId);
      },
      // 点击行
      clickRow(record) {
        return {
          on: {
            // 双击行
            dblclick: () => {
              let _this = this;
              this.lookImg = [];
              // console.log("双击行");
              this.photoSpinning = true;
              this.photoVisible = true;
              this.getPhotoList(record.orderId);
              // this.lookImg.push(require("@/assets/noImg.png"));
              // setTimeout(function () {
              //   _this.photoSpinning = false;
              // }, 2000)
            },
          }
        }

      },
      // 获取忘带卡类型
      async getBdSysItemTypeList() {
        let resp = await reservationApi.getBdSysItemTypeList({typeId: 208});
        // console.log(resp);
        if (resp.data.success) {
          this.forgotTypes = [...this.forgotTypes, ...resp.data.result];
        } else {
          this.$message.error(resp.data.message);
        }
      },
      // 获取图片
      async getPhotoList(id) {
        let resp = await reservationApi.getAttachmentNameList({orderId: id});
        // console.log(resp.data);
        if (resp.data.success) {
          this.lookImg = resp.data.result;
          this.photoSpinning = false;
        } else {
          this.photoSpinning = false;
          this.$message.error(resp.data.message);
        }
      },
      // 获取基地信息
      async findRegionList() {
        let resp = await reservationApi.getBdSysItemList({typeId: 200});
        // console.log(resp);
        if (resp.data.success) {
          this.baceType = [...this.baceType, ...resp.data.result];
          // console.log(this.baceType)
        } else {
          this.$message.error(resp.data.message);
        }
      },
      // 获取区域
      async getAreaList() {
        let res = await reservationApi.getBdVisitAreaListByRoleNew({typeId: this.visitBaseId})
        // console.log(res.data);
        if (res.data.success) {
          this.areaList = [{areaName: "全部", id: 0}];
          this.areaList = [...this.areaList, ...res.data.result];
          // console.log(this.areaList)
        } else {
          this.$message.error(res.data.message);
        }
      },
      // 获取门列表
      async getDoorList() {
        // console.log("区域id："+this.visitAreaId);
        let res = await reservationApi.getSysItemByArea({areaId: ""})
        // console.log(res.data);
        if (res.data.success) {
          this.doorList = [{name: "全部", typeId: ""}];
          this.doorList = [...this.doorList, ...res.data.result];
          // this.doorName = res.data.result[0].name;
          // this.doorId = res.data.result[0].typeId;
          // console.log(this.doorList)
        } else {
          this.$message.error(res.data.message);
        }
      },
      // 获取访客类型
      async getVisitorType() {
        // 跟区域和门有关联得参数，不使用了
        // let param = {
        //   relatedType: (this.visitBaseId == 99 && this.visitAreaId == "") ? "":this.isHaveDoor === 0?1:2,    // 标识： 1区域id   2门id  ，isHaveDoor 0没有门 1有门
        //   relatedId: (this.visitBaseId == 99 && this.visitAreaId == "") ? "":this.isHaveDoor === 0?this.visitAreaId:this.doorId ,  //厂区id
        // };
        let param = {
          relatedType: "",
          relatedId: ""
        };
        let res = await reservationApi.getVisitorsType(param)
        // console.log(res.data);
        if (res.data.success) {
          this.visitorTypeList = [{name: "全部", typeId: 99}];
          this.visitorTypeList = [...this.visitorTypeList, ...res.data.result];
          // console.log(this.visitorTypeList)
        } else {
          this.$message.error(res.data.message);
        }
      },

      // 表格切换分页
      handleTableChange(pagination, filters, sorter) {
        this.startDated = this.startDate == "" || this.startDate == null ? "" : moment(this.startDate).format('YYYY-MM-DD');
        this.endDated = this.endDated == "" || this.endDated == null ? "" : moment(this.endDate).format('YYYY-MM-DD');
        // console.log(pagination);
        const pager = {...this.pagination};
        pager.current = pagination.current;
        this.pagination = pager;
        this.fetch({
          pageSize: pagination.pageSize,
          current: pagination.current,
          startDate: this.startDated,
          endDate: this.endDated,
          // approvalStatus: this.statusId,
          searchTxt: this.queryValue,
          baseId: this.visitBaseId,   //0查全部，或者基地id
          areaId: this.visitAreaId == "" ? 0 : this.visitAreaId,   //0查全部，或者区域id
          // doorId: this.doorId,
          // visitorState: this.visitTypeId,
          // visitorsType: this.visitorTypeId,
          sortField: sorter.field,
          sortOrder: sorter.order,
          ...filters,
        });
      },

      handleCancel() {
        this.photoVisible = false
      },

      savephoto() {
        let length = this.lookImg.length;
        for (let i = 0; i < length; i++) {
          let createA = document.createElement("a");
          let src = this.lookImg[i];
          createA.id = "img_" + i;
          createA.href = src;
          createA.download = src;
          createA.target = "_blank";
          // console.log(createA);
          document.body.appendChild(createA);
        }
        for (let j = 0; j < length; j++) {
          if (document.getElementById("img_" + j)) {
            //重点：触发a标签的click事件，触发事件后移除该图片元素标签
            document.getElementById("img_" + j).click();
            document.body.removeChild(document.getElementById("img_" + j));
          }
        }
      },

      onChange(selectedRowKeys, selectedRows) {
        // console.log(selectedRowKeys, selectedRows);
        this.selectedRowKeys = selectedRowKeys;
      },
      // 请求表格数据--测试用
      async fetch(params) {
        this.loading = true;
        let resp = await forgotCardManageApi.getForgotCardEmpList(params);
        // console.log(resp.data);
        if (resp.data && resp.data.success) {
          // console.log("111");
          this.loading = false;
          this.pagination.total = resp.data.result.total;
          this.tableData = resp.data.result.records;

        } else {
          // console.log("222");
          this.loading = false;
          this.$message.error(resp.data.message);
        }

        // 测试
        // setTimeout(() => {
        //   this.tableData=[
        //     {serialNumber:"0",oddNumber:"14",visitName:"王晓明",visitCompony:"上海步达",visitTel:"13345674568",vistorCertNumber:"410526194601114235",userLname:"冯伟",userTelephone:"17612345678",visitDateBegin:"2020-10-10 08:00:00",visitDateEnd:"2020-10-10 17:30:00",entourage:"主访客",approvalStatus:"已通过"},
        //     {serialNumber:"0",oddNumber:"14",visitName:"王晓明",visitCompony:"上海步达",visitTel:"13345674568",vistorCertNumber:"410526194601114235",userLname:"冯伟",userTelephone:"17612345678",visitDateBegin:"2020-10-10 08:00:00",visitDateEnd:"2020-10-10 17:30:00",entourage:"主访客",approvalStatus:"已通过"},
        //   ];
        // this.tableData=this.tableData.map((el,i)=>{
        //    el.serialNumber = i + 1;
        //    return el
        // });
        // console.log(this.tableData);
        //   this.loading = false;
        // }, 2000);
      },


    },
  }
</script>

<style scoped>


</style>

